package com.jrx.anytxn.param.dto.aviator;


import com.jrx.anytxn.param.enums.Match;
import com.jrx.anytxn.param.enums.OperateType;
import com.jrx.anytxn.param.enums.ValueType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.io.Serializable;
import java.util.List;

/**
 * 条件组
 * @author by yxy on 2017/5/22.
 */
@ApiModel(value = "条件组")
public class ConditionGroupReq extends ConditionReq implements Serializable {

    private static final long serialVersionUID = -2166925128729826798L;

    @ApiModelProperty(value = "节点类型 1不含子节点 2含子节点")
    private Integer nodeType;
    @ApiModelProperty(value = "节点id")
    private Integer nodeId;
    @ApiModelProperty(value = "满足条件判断", example = "ALL／ONE")
    @Enumerated(EnumType.STRING)
    private Match match;
    @ApiModelProperty(value = "节点维度")
    private Integer nodeLevel;
    @ApiModelProperty(value = "符号")
    @Enumerated(EnumType.STRING)
    private OperateType operateType;
    @ApiModelProperty(value = "符号名称")
    private String operatorName;
    @ApiModelProperty(value = "是否有值")
    private Boolean hasValue;
    @ApiModelProperty(value = "列表前n项，-1表示全部")
    private Integer listNum;
    @ApiModelProperty(value = "匹配列表类型，all/any")
    private Match listType;
    @ApiModelProperty(value = "字段bid")
    private String fieldBid;
    @ApiModelProperty(value = "值类型")
    private ValueType valueType;
    @ApiModelProperty(value = "默认值")
    private String defaultValue;
    @ApiModelProperty(value = "值为字段时bid,不为字段时为空")
    private String fieldValueBid;
    @ApiModelProperty(value = "值为字段时字段类型,不为字段时为空")
    private ValueType valueFieldValueType;
    @ApiModelProperty(value = "值为字段时字段默认值,不为字段时为空")
    private String valueFieldDefaultValue;
    @ApiModelProperty(value = "字段名称")
    private String fieldName;
    @ApiModelProperty(value = "节点显示内容")
    private String nodeText;
    @ApiModelProperty(value = "值")
    private List<String> values;
    @ApiModelProperty(value = "子节点")
    private List<ConditionGroupReq> children;


    public Match getMatch() {
        return match;
    }

    public void setMatch(Match match) {
        this.match = match;
    }

    public Integer getNodeType() {
        return nodeType;
    }

    public void setNodeType(Integer nodeType) {
        this.nodeType = nodeType;
    }

    public Integer getNodeId() {
        return nodeId;
    }

    public void setNodeId(Integer nodeId) {
        this.nodeId = nodeId;
    }

    public Integer getNodeLevel() {
        return nodeLevel;
    }

    public void setNodeLevel(Integer nodeLevel) {
        this.nodeLevel = nodeLevel;
    }

    public OperateType getOperateType() {
        return operateType;
    }

    public void setOperateType(OperateType operateType) {
        this.operateType = operateType;
        if (operateType != null) {
            this.operatorName = operateType.getDescription();
        }
    }

    public String getFieldBid() {
        return fieldBid;
    }

    public void setFieldBid(String fieldBid) {
        this.fieldBid = fieldBid;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getNodeText() {
        return nodeText;
    }

    public void setNodeText(String nodeText) {
        this.nodeText = nodeText;
    }

    public List<String> getValues() {
        return values;
    }

    public void setValues(List<String> values) {
        this.values = values;
    }

    public List<ConditionGroupReq> getChildren() {
        return children;
    }

    public void setChildren(List<ConditionGroupReq> children) {
        this.children = children;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public Boolean getHasValue() {
        return hasValue;
    }

    public void setHasValue(Boolean hasValue) {
        this.hasValue = hasValue;
    }

    public String getFieldValueBid() {
        return fieldValueBid;
    }

    public ValueType getValueType() {
        return valueType;
    }

    public void setValueType(ValueType valueType) {
        this.valueType = valueType;
    }

    public void setFieldValueBid(String fieldValueBid) {
        this.fieldValueBid = fieldValueBid;
    }

    public Integer getListNum() {
        return listNum;
    }

    public void setListNum(Integer listNum) {
        this.listNum = listNum;
    }

    public Match getListType() {
        return listType;
    }

    public void setListType(Match listType) {
        this.listType = listType;
    }

    public ValueType getValueFieldValueType() {
        return valueFieldValueType;
    }

    public void setValueFieldValueType(ValueType valueFieldValueType) {
        this.valueFieldValueType = valueFieldValueType;
    }

    public String getValueFieldDefaultValue() {
        return valueFieldDefaultValue;
    }

    public void setValueFieldDefaultValue(String valueFieldDefaultValue) {
        this.valueFieldDefaultValue = valueFieldDefaultValue;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }


}
